﻿<ChartGadgets:ChartGadgetBase x:Class="EpiDashboard.Gadgets.Charting.ColumnChartGadget"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:EpiDashboard="clr-namespace:EpiDashboard"
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
             xmlns:ChartGadgets="clr-namespace:EpiDashboard.Gadgets.Charting"
             xmlns:charting="clr-namespace:ComponentArt.Win.DataVisualization.Charting;assembly=ComponentArt.Win.DataVisualization.Charting"
             mc:Ignorable="d" 
             d:DesignHeight="900" d:DesignWidth="600"
                         SnapsToDevicePixels="True"
             Style="{DynamicResource gadgetBaseStyle}" MouseRightButtonUp="ChartGadgetBase_MouseRightButtonUp">
    <ChartGadgets:ChartGadgetBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--<ResourceDictionary Source="pack://application:,,,/EpiDashboard;component/ResourceDictionary.xaml" />-->
                <ResourceDictionary Source="../../ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </ChartGadgets:ChartGadgetBase.Resources>
    <Grid>
        <Border Name="borderAll" Style="{DynamicResource mainGadgetBorder}" Background="White" >
            <Border.ContextMenu>
                <ContextMenu x:Name="gadgetContextMenu">
                    <MenuItem x:Name="mnuCopy" Header="Copy all chart data to clipboard"/>
                    <MenuItem x:Name="mnuSendDataToHTML" Header="Send to web browser" />
                    <Separator x:Name="separatorCurrentChart" />
                    <!--<MenuItem x:Name="mnuSendDataToExcel" Header="Send data to Excel" />-->
                    <MenuItem x:Name="mnuCurrentChart" StaysOpenOnClick="True" Header="Selected chart:" Background="LightGray"/>
                    <MenuItem x:Name="mnuSaveSelectedChartAsImage" Header="Save chart as image..." Click="mnuSaveSelectedChartAsImage_Click" />
                    <MenuItem x:Name="mnuCopySelectedChartImage" Header="Copy chart image to clipboard" Click="mnuCopySelectedChartImage_Click" />
                    <MenuItem x:Name="mnuCopySelectedChartData" Header="Copy chart data to clipboard" Click="mnuCopySelectedChartData_Click" />
                    <Separator/>
                    <MenuItem x:Name="mnuSendToBack" Header="Send gadget to back"/>
                    <MenuItem x:Name="mnuClose" Header="Close this gadget"/>
                </ContextMenu>
            </Border.ContextMenu>

            <Grid x:Name="grdMain">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>

                <Controls:GadgetHeaderPanel x:Name="headerPanel" Grid.Row="0" Text="Column Chart" />
                <Controls:GadgetMessagePanel Margin="4" x:Name="messagePanel" Grid.Row="2" Text="" />
                <Controls:GadgetDescriptionPanel Grid.Row="4" PanelMode="Collapsed" x:Name="descriptionPanel"></Controls:GadgetDescriptionPanel>

                <Controls:GadgetInfoPanel Grid.Row="4" Visibility="Collapsed" Margin="4" x:Name="infoPanel"></Controls:GadgetInfoPanel>
                <StackPanel Grid.Row="7" x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid x:Name="gridChartLayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <TextBlock x:Name="tblockChartTitle" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" FontSize="16" FontWeight="Bold" Margin="0, 6, 0, 6" Visibility="Collapsed" />

                        <Canvas x:Name="yAxisLabelCanvas" Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="Auto" Margin="6, 0, -20, 0" >
                            <TextBlock x:Name="tblockYAxisLabel" FontWeight="DemiBold" Canvas.Bottom="0" Canvas.Left="0" TextAlignment="Center" Margin="0,0,0,-20" Text="Count" Visibility="Collapsed" >                    
                                <TextBlock.RenderTransform>
                                    <TransformGroup>                                
                                        <RotateTransform x:Name="rotate" Angle="270" />
                                    </TransformGroup>
                                </TextBlock.RenderTransform>
                            </TextBlock>
                        </Canvas>

                        <TextBlock x:Name="tblockXAxisLabel" FontWeight="DemiBold" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0, 0, 0, 6" Visibility="Collapsed" />

                        <!--<charting:XYChart x:Name="xyChart" XPath="S" Grid.Row="0" Grid.Column="1" DataStructureCreated="xyChart_DataStructureCreated">
                            <charting:XYChart.XAxisArea>
                                <charting:AxisCoordinates x:Name="xAxisCoordinates" Angle="0" />
                            </charting:XYChart.XAxisArea>
                            <charting:XYChart.Axes>
                                <charting:Axis Id="YAxis" x:Name="yAxis" UseReferenceValue="true" />
                            </charting:XYChart.Axes>
                            <charting:BarSeries x:Name="series0" Id="S0" YPath="Y" SeriesPath="X" ShowPointAnnotations="True" BarKind="Rectangle" />                        
                        </charting:XYChart>-->
                    </Grid>
                </StackPanel>
                <Controls:GadgetWaitPanel x:Name="waitPanel" Visibility="Collapsed" Grid.Row="1" Grid.RowSpan="6" Style="{StaticResource gadgetWaitPanelStyle}" />

                <StackPanel Grid.Row="1" Grid.RowSpan="7" Margin="00,-15,-10,0"  HorizontalAlignment="Right" VerticalAlignment="Top" >
                    <Grid x:Name="ConfigGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,10,0" >
                        <Rectangle Style="{DynamicResource rectangleConfigOuter}" />
                        <Rectangle Style="{DynamicResource rectangleConfigInner}" />

                        <Path x:Name="pathTriangle" 
                              Margin="0,-2,90,0"
                              Data="M 5 0 L 10 10 0 10 Z" Fill="{DynamicResource gadgetBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Right" VerticalAlignment="Top" Height="7" />

                        <StackPanel Orientation="Vertical" Margin="25, 10, 25, 25" HorizontalAlignment="Center" VerticalAlignment="Top" >
                            <!--<TextBlock x:Name="ConfigExpandedTitle" HorizontalAlignment="Center" TextAlignment="Center" Text="Settings" Margin="5" FontSize="13" FontWeight="Bold" />-->
                            <TextBlock x:Name="tblockMainVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Main variable:" Margin="0,5,0,0"  />
                            <ComboBox x:Name="cmbField" Width="140" HorizontalAlignment="Left" SelectedIndex="0" SelectionChanged="cmbField_SelectionChanged" />

                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="5"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0">
                                    <TextBlock x:Name="tblockWidth" HorizontalAlignment="Left" TextAlignment="Center" Text="Width:" Margin="0,5,0,0"  />
                                    <TextBox x:Name="txtWidth" Text="800" />
                                </StackPanel>

                                <StackPanel Grid.Column="2">
                                    <TextBlock x:Name="tblockHeight" HorizontalAlignment="Left" TextAlignment="Center" Text="Height:" Margin="0,5,0,0"  />
                                    <TextBox x:Name="txtHeight" Text="500" />
                                </StackPanel>
                            </Grid>

                            <Expander Margin="0, 5, 0, 0" x:Name="expanderAdvancedOptions">
                                <Expander.Header>
                                    <TextBlock>Advanced options</TextBlock>
                                </Expander.Header>
                                <Border Style="{StaticResource configGroupBorderStyle}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition></ColumnDefinition>
                                            <ColumnDefinition Width="15"></ColumnDefinition>
                                            <ColumnDefinition></ColumnDefinition>
                                            <ColumnDefinition Width="15"></ColumnDefinition>
                                            <ColumnDefinition></ColumnDefinition>
                                        </Grid.ColumnDefinitions>

                                        <StackPanel x:Name="panelAdvanced1" Visibility="Visible">
                                            <TextBlock x:Name="tblockWeightVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Weight:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbFieldWeight" Width="140" HorizontalAlignment="Left" SelectedIndex="0" />

                                            <TextBlock x:Name="tblockCrosstabVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="One graph for each value of:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbFieldCrosstab" Width="140" HorizontalAlignment="Left" SelectedIndex="0" />

                                            <TextBlock x:Name="tblockStrataVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Stratify by:" Margin="0,5,0,0"  />
                                            <ListBox x:Name="listboxFieldStrata" Width="180" Height="120" SelectionMode="Extended" HorizontalAlignment="Left" />
                                        </StackPanel>

                                        <StackPanel Grid.Column="2" x:Name="panelAdvanced2" Visibility="Visible">
                                            <CheckBox x:Name="checkboxAllValues" Margin="0,5,0,0" Content="Display all list values"  HorizontalAlignment="Left" />
                                            <CheckBox x:Name="checkboxCommentLegalLabels" Margin="0,5,0,0" Content="Display list labels"  HorizontalAlignment="Left" />
                                            <CheckBox x:Name="checkboxSortHighLow" Margin="0,5,0,0" Content="Sort high to low" HorizontalAlignment="Left" />
                                            <CheckBox x:Name="checkboxIncludeMissing" Margin="0,5,0,0" Content="Include missing values" HorizontalAlignment="Left" IsChecked="False" />
                                            <!--<CheckBox x:Name="checkboxConfBars" Margin="0,5,0,0" Content="Show confidence intervals" HorizontalAlignment="Left" IsChecked="False" />-->
                                        </StackPanel>

                                        <StackPanel Grid.Column="4" x:Name="panelAdvanced3" Visibility="Visible">
                                            <TextBlock x:Name="tblockSecondYAxis" HorizontalAlignment="Left" TextAlignment="Center" Text="Second y-axis type:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbSecondYAxis" Width="140" HorizontalAlignment="Left" SelectedIndex="0" SelectionChanged="cmbSecondYAxis_SelectionChanged">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>None</ComboBoxItem>
                                                    <ComboBoxItem>Single field</ComboBoxItem>
                                                    <ComboBoxItem>Rate per 100k population</ComboBoxItem>
                                                    <ComboBoxItem>Cumulative percent</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockSecondYAxisVariable" HorizontalAlignment="Left" TextAlignment="Center" Text="Second y-axis variable:" Margin="0,5,0,0" Visibility="Collapsed" />
                                            <ComboBox x:Name="cmbSecondYAxisVariable" Width="140" HorizontalAlignment="Left" Visibility="Collapsed" />

                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </Expander>

                            <Expander Margin="0, 5, 0, 0" x:Name="expanderDisplayOptions">
                                <Expander.Header>
                                    <TextBlock>Display options</TextBlock>
                                </Expander.Header>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition></ColumnDefinition>
                                        <ColumnDefinition Width="15"></ColumnDefinition>
                                        <ColumnDefinition></ColumnDefinition>
                                        <ColumnDefinition Width="15"></ColumnDefinition>
                                        <ColumnDefinition></ColumnDefinition>
                                    </Grid.ColumnDefinitions>

                                    <Border Style="{StaticResource configGroupBorderStyle}" Grid.Column="0">
                                        <StackPanel Grid.Column="0" x:Name="panelDisplay1">
                                            <Label x:Name="lblColorsStyles" FontWeight="Bold">Colors and styles</Label>
                                            <CheckBox x:Name="checkboxUseDiffColors" Margin="0,5,0,0" Content="Different bar colors" HorizontalAlignment="Left" IsChecked="False" />
                                            <CheckBox x:Name="checkboxUseRefValues" Margin="0,5,0,0" Content="Use reference values" HorizontalAlignment="Left" IsChecked="True" />
                                            <CheckBox x:Name="checkboxAnnotations" Margin="0,5,0,0" Content="Show annotations" HorizontalAlignment="Left" IsChecked="False" />
                                            <CheckBox x:Name="checkboxAnnotationsY2" Margin="0,5,0,0" Content="Show annotations (Y2)" HorizontalAlignment="Left" IsEnabled="False" IsChecked="False" />
                                            <CheckBox x:Name="checkboxGridLines" Margin="0,5,0,0" Content="Show grid lines" HorizontalAlignment="Left" IsChecked="True" />

                                            <TextBlock x:Name="tblockComposition" HorizontalAlignment="Left" TextAlignment="Center" Text="Composition:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbComposition" Width="140" HorizontalAlignment="Left" SelectedIndex="0" >
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Side-by-side</ComboBoxItem>
                                                    <ComboBoxItem>Stacked</ComboBoxItem>
                                                    <ComboBoxItem>Stacked 100</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockBarSpacing" HorizontalAlignment="Left" TextAlignment="Center" Text="Space between bars:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbBarSpacing" Width="140" HorizontalAlignment="Left" SelectedIndex="0">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Default</ComboBoxItem>
                                                    <ComboBoxItem>None</ComboBoxItem>
                                                    <ComboBoxItem>Small</ComboBoxItem>
                                                    <ComboBoxItem>Medium</ComboBoxItem>
                                                    <ComboBoxItem>Large</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockOrientation" HorizontalAlignment="Left" TextAlignment="Center" Text="Orientation:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbOrientation" Width="140" HorizontalAlignment="Left" SelectedIndex="0">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Vertical</ComboBoxItem>
                                                    <ComboBoxItem>Horizontal</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockPalette" HorizontalAlignment="Left" TextAlignment="Center" Text="Color palette:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbPalette" Width="140" HorizontalAlignment="Left" SelectedIndex="12">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Atlantic</ComboBoxItem>
                                                    <ComboBoxItem>Breeze</ComboBoxItem>
                                                    <ComboBoxItem>ComponentArt</ComboBoxItem>
                                                    <ComboBoxItem>Deep</ComboBoxItem>
                                                    <ComboBoxItem>Earth</ComboBoxItem>
                                                    <ComboBoxItem>Evergreen</ComboBoxItem>
                                                    <ComboBoxItem>Heatwave</ComboBoxItem>
                                                    <ComboBoxItem>Montreal</ComboBoxItem>
                                                    <ComboBoxItem>Pastel</ComboBoxItem>
                                                    <ComboBoxItem>Renaissance</ComboBoxItem>
                                                    <ComboBoxItem>SharePoint</ComboBoxItem>
                                                    <ComboBoxItem>Study</ComboBoxItem>
                                                    <ComboBoxItem>VibrantA</ComboBoxItem>
                                                    <ComboBoxItem>VibrantB</ComboBoxItem>
                                                    <ComboBoxItem>VibrantC</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockBarType" HorizontalAlignment="Left" TextAlignment="Center" Text="Bar type:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbBarType" Width="140" HorizontalAlignment="Left" SelectedIndex="2">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Block</ComboBoxItem>
                                                    <ComboBoxItem>Cylinder</ComboBoxItem>
                                                    <ComboBoxItem>Rectangle</ComboBoxItem>
                                                    <ComboBoxItem>RoundedBlock</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockLineTypeY2" HorizontalAlignment="Left" TextAlignment="Center" Text="Line type (Y2):" Margin="0,5,0,0" />
                                            <ComboBox x:Name="cmbLineTypeY2" Width="140" HorizontalAlignment="Left" SelectedIndex="0" IsEnabled="False">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Auto</ComboBoxItem>
                                                    <ComboBoxItem>Polygon</ComboBoxItem>
                                                    <ComboBoxItem>Smooth</ComboBoxItem>
                                                    <ComboBoxItem>Step</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockLineDashTypeY2" HorizontalAlignment="Left" TextAlignment="Center" Text="Line dash style (Y2):" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbLineDashTypeY2" Width="140" HorizontalAlignment="Left" SelectedIndex="4" IsEnabled="False">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Dash</ComboBoxItem>
                                                    <ComboBoxItem>Dash Dot</ComboBoxItem>
                                                    <ComboBoxItem>Dash Dot Dot</ComboBoxItem>
                                                    <ComboBoxItem>Dot</ComboBoxItem>
                                                    <ComboBoxItem>Solid</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockLineThicknessY2" HorizontalAlignment="Left" TextAlignment="Center" Text="Line thickness (Y2):" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbLineThicknessY2" Width="140" HorizontalAlignment="Left" SelectedIndex="1" IsEnabled="False">
                                                <ComboBox.Items>
                                                    <ComboBoxItem>1</ComboBoxItem>
                                                    <ComboBoxItem>2</ComboBoxItem>
                                                    <ComboBoxItem>3</ComboBoxItem>
                                                    <ComboBoxItem>4</ComboBoxItem>
                                                    <ComboBoxItem>5</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockStartValue" HorizontalAlignment="Left" TextAlignment="Center" Text="X-axis start value:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtStartValue" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockEndValue" HorizontalAlignment="Left" TextAlignment="Center" Text="X-axis end value:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtEndValue" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockToValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Y-axis max value:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtToValue" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockFromValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Y-axis min value:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtFromValue" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblocktStepValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Y-axis step value:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtStepValue" HorizontalAlignment="Stretch" />

                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource configGroupBorderStyle}" Grid.Column="2">
                                        <StackPanel Grid.Column="2" x:Name="panelDisplay2">
                                            <Label x:Name="lblLabels" FontWeight="Bold">Labels</Label>
                                            <TextBlock x:Name="tblockYAxisLabelValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Y-axis label:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtYAxisLabelValue" HorizontalAlignment="Stretch" Text="Count" />

                                            <TextBlock x:Name="tblockYAxisFormatString" HorizontalAlignment="Left" TextAlignment="Center" Text="Y-axis format:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtYAxisFormatString" HorizontalAlignment="Stretch" Text="" />

                                            <TextBlock x:Name="tblockY2AxisLabelValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Y2-axis label:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtY2AxisLabelValue" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockY2AxisLegendTitle" HorizontalAlignment="Left" TextAlignment="Center" Text="Y2-axis legend title:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtY2AxisLegendTitle" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockY2AxisFormatString" HorizontalAlignment="Left" TextAlignment="Center" Text="Y2-axis format:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtY2AxisFormatString" HorizontalAlignment="Stretch" Text="" />

                                            <TextBlock x:Name="tblockXAxisLabelType" HorizontalAlignment="Left" TextAlignment="Center" Text="X-axis label type:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbXAxisLabelType" Width="140" HorizontalAlignment="Left" SelectedIndex="0" SelectionChanged="cmbXAxisLabelType_SelectionChanged" >
                                                <ComboBox.Items>
                                                    <ComboBoxItem>Automatic</ComboBoxItem>
                                                    <ComboBoxItem>Field Prompt</ComboBoxItem>
                                                    <ComboBoxItem>None</ComboBoxItem>
                                                    <ComboBoxItem>Custom</ComboBoxItem>
                                                </ComboBox.Items>
                                            </ComboBox>

                                            <TextBlock x:Name="tblockXAxisLabelValue" HorizontalAlignment="Left" TextAlignment="Center" Text="X-axis label:" Margin="0,5,0,0" />
                                            <TextBox x:Name="txtXAxisLabelValue" HorizontalAlignment="Stretch" Text="" IsEnabled="False" />

                                            <TextBlock x:Name="tblockXAxisAngle" HorizontalAlignment="Left" TextAlignment="Center" Text="X-axis angle:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtXAxisAngle" HorizontalAlignment="Stretch" Text="0" />

                                            <TextBlock x:Name="tblockChartTitleValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Chart title:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtChartTitle" AcceptsReturn="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" />

                                            <TextBlock x:Name="tblockChartSubTitleValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Chart subtitle:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtChartSubTitle" AcceptsReturn="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" />
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource configGroupBorderStyle}" Grid.Column="4">
                                        <StackPanel Grid.Column="0" x:Name="panelDisplay3">
                                            <Label x:Name="lblLegend" FontWeight="Bold">Legend</Label>
                                            <CheckBox x:Name="checkboxShowLegend" Margin="0,5,0,0" Content="Show legend" HorizontalAlignment="Left" IsChecked="False" />
                                            <CheckBox x:Name="checkboxShowLegendBorder" Margin="0,5,0,0" Content="Show legend border" HorizontalAlignment="Left" IsChecked="False" />
                                            <CheckBox x:Name="checkboxShowVarName" Margin="0,5,0,0" Content="Show variable names" HorizontalAlignment="Left" IsChecked="False" />

                                            <TextBlock x:Name="tblockLegendFontSize" HorizontalAlignment="Left" TextAlignment="Center" Text="Legend font size:" Margin="0,5,0,0"  />
                                            <TextBox x:Name="txtLegendFontSize" HorizontalAlignment="Stretch" Text="12" />

                                            <TextBlock x:Name="tblockLegendDock" HorizontalAlignment="Left" TextAlignment="Center" Text="Legend placement:" Margin="0,5,0,0"  />
                                            <ComboBox x:Name="cmbLegendDock" Width="140" HorizontalAlignment="Left" />

                                            <!--<TextBlock x:Name="tblockLegendFontFamily" HorizontalAlignment="Left" TextAlignment="Center" Text="Legend font family:" Margin="0,5,0,0" />
                                            <ComboBox Width="140" x:Name="cmbFontSelector" HorizontalAlignment="Left" SelectionChanged="cmbFontSelector_SelectionChanged">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding}" FontFamily="{Binding}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>-->
                                        </StackPanel>
                                    </Border>
                                </Grid>
                            </Expander>
                            <Button x:Name="btnRun" Content="Run" Margin="0,20,0,0" Click="btnRun_Click" />
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</ChartGadgets:ChartGadgetBase>
